package com.dou.cloud.bridge.redis.handler;


import com.dou.cloud.bridge.redis.enums.RedissonEnum;
import com.due.basic.tookit.function.DueVoidProducer;

import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

/**
 * @Author daizl
 * @Date 2024 06 20 12 27
 **/
public class WriteLock extends AbstractDistributedLockHandler {

    @Override
    public <T> T tryLock(Supplier<Object> supplier, String key, long waitTime, long leaseTime, TimeUnit timeUnit) {
        return executeOperation(supplier, key, waitTime, leaseTime, timeUnit, true);
    }

    @Override
    public Integer getType() {
        return RedissonEnum.WRITE_LOCK.getType();
    }
}

